package com.java.program_questions;

import java.util.Scanner;

/**
 * 问题：一个5位数，判断它是不是回文数，例如12321是回文数
 * 分析：
 */
public class Question25 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入一个五位数：");
        String number = sc.nextLine();

        if (number.length() != 5) {
            System.out.print("输入错误");
        } else {
            boolean isTure = true;
            for (int i = 0; i < number.length() / 2; i++) {
                if (number.charAt(i) == number.charAt(4 - i)) {
                    continue;
                } else {
                    isTure = false;
                    break;
                }
            }
            if (!isTure) {
                System.out.print(number + "不是回文数");
            } else {
                System.out.print(number + "是回文数");
            }
        }
    }
}
